﻿namespace WMS6.Web
{
    using System;
    using WMS6.Web.LoginServiceRef;

    public class LoginServiceClientProxy : BasePage
    {
        public static LoginServiceClientProxy GetInstance()
        {
            return new LoginServiceClientProxy();
        }

        public PreferenceProfileInfo GetPreferenceProfileByUserID(string userID)
        {
            using (LoginServiceClient client = new LoginServiceClient("WSHttpBinding_ILoginService"))
            {
                return client.GetPreferenceProfileByUserID(userID);
            }
        }

        public UserMstInfo GetUserInfoByID(string userID)
        {
            using (LoginServiceClient client = new LoginServiceClient("WSHttpBinding_ILoginService"))
            {
                return client.GetUserInfoByID(userID);
            }
        }

        public string InsertUserPreference(PreferenceProfileInfo preferencePrifile)
        {
            using (LoginServiceClient client = new LoginServiceClient("WSHttpBinding_ILoginService"))
            {
                return client.InsertUserPreference(preferencePrifile);
            }
        }

        public void WriteLoginLog(SysLoginLogInfo sysLoginLog)
        {
            using (LoginServiceClient client = new LoginServiceClient("WSHttpBinding_ILoginService"))
            {
                client.InsertSysLoginLogInfo(sysLoginLog);
            }
        }
    }
}

